#include <glib.h>

typedef struct employee_info_tag {
    gint id;
    gchar *name;
}employee_info_t;

gint main(gint argc, gchar **argv)
{
    GArray *arr = NULL;
    guint n = 0;

    arr = g_array_new(FALSE, FALSE, sizeof(gint));
    n = g_array_get_element_size(arr);
    g_print("element size:%d, array len:%d \n", n, arr->len);
    g_array_free(arr, TRUE);

    arr = g_array_new(TRUE, TRUE, sizeof(gint));
    n = g_array_get_element_size(arr);
    g_print("element size:%d, array len:%d \n", n, arr->len);
    g_array_free(arr, TRUE);

    arr = g_array_new(FALSE, TRUE, sizeof(employee_info_t));
    n = g_array_get_element_size(arr);
    g_print("element size:%d, array len:%d \n", n, arr->len);
    g_array_free(arr, TRUE);

    arr = g_array_sized_new(FALSE, TRUE, sizeof(employee_info_t), 100);
    n = g_array_get_element_size(arr);
    g_print("element size:%d, array len:%d \n", n, arr->len);
    g_array_free(arr, TRUE);


    return 0;
}